home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Expander / Sample Source / CApp.cp < prev    next >
Encoding:
Text File  |  1994-11-30  |  3.7 KB  |  128 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CApp.cp
  3.  
  4.                 My Application Class
  5.     
  6.     Copyright Â© 1994 My Software Inc. All rights reserved.
  7.  
  8.     Generated by Visual Architectâ„¢ 9:40 PM Wed, Jun 8, 1994
  9.  
  10.     This file is only generated once. You can modify it by filling
  11.     in the placeholder methods and adding any new methods you wish.
  12.  
  13.     If you change the name of the application, a fresh version of this
  14.     file will be generated. If you have made any changes to the file
  15.     with the old name, you will have to copy those changes to the new
  16.     file by hand.
  17.  
  18.  ******************************************************************************/
  19.  
  20. #include "CApp.h"
  21.  
  22. #include <CDialog.h>
  23. #include <TCLForceReferences.h>
  24.  
  25. TCL_DEFINE_CLASS_M1(CApp, x_CApp);
  26.  
  27. /**** C O N S T R U C T I O N / D E S T R U C T I O N   M E T H O D S ****/
  28.  
  29.  
  30. /******************************************************************************
  31.  ICApp
  32.  
  33.         Initialize an Application.
  34.  
  35.  ******************************************************************************/
  36.  
  37. void    CApp::ICApp()
  38.  
  39. {
  40.         // The values below are:
  41.         //
  42.         //     extraMasters        - The number of additional master pointer blocks
  43.         //                          to be allocated.
  44.         //     aRainyDayFund        - The total amount of reserved memory. When
  45.         //                          allocation digs into the rainy day fund, the
  46.         //                          user is notified that memory is low. Set this
  47.         //                          value to the sum of aCriticalBalance plus
  48.         //                          aToolboxBalance plus a fudge for user warning.
  49.         //     aCriticalBalance    - The part of the rainy day fund reserved for
  50.         //                          critical operations, like Save or Quit. Set
  51.         //                          this value to the memory needed for the largest
  52.         //                          possible Save plus aToolboxBalance. This
  53.         //                          memory will only be used if SetCriticalOperation()
  54.         //                          is set TRUE or if RequestMemory()/SetAllocation()
  55.         //                          is set FALSE (kAllocCantFail).
  56.         //     aToolboxBalance    - The part of the rainy day fund reserved for
  57.         //                          ToolBox bozos that bomb if a memory request fails.
  58.         //                          This memory is used unless RequestMemory()/
  59.         //                          SetAllocation() is set TRUE (kAllocCanFail).
  60.         //                          Almost all TCL memory allocation is done with
  61.         //                          kAllocCanFail, and yours should be, too. The
  62.         //                          default 2K is probably enough.
  63.  
  64.     Ix_CApp(4, 24000L, 20480L, 2048L);
  65.     
  66.         // Initialize your own application data here.
  67.         
  68. }
  69.  
  70.  
  71. /******************************************************************************
  72.  ForceClassReferences    {OVERRIDE}
  73.  
  74.     Reference classes that do object I/O or are created only
  75.     by new_by_name.
  76.  ******************************************************************************/
  77.  
  78. void CApp::ForceClassReferences(void)
  79.  
  80. {
  81.     x_CApp::ForceClassReferences();
  82.     
  83.         // Insert your own class references here
  84.         // by calling TCL_FORCE_REFERENCE for each class
  85.         // See x_CApp.cp
  86. }
  87.  
  88.  
  89. /**** C O M M A N D   M E T H O D S ****/
  90.  
  91.  
  92. /******************************************************************************
  93.  DoCommand    {OVERRIDE}
  94.  
  95.     Handle application commands
  96.  ******************************************************************************/
  97.  
  98. void CApp::DoCommand(long theCommand)
  99.  
  100. {
  101.     switch (theCommand)
  102.     {
  103.  
  104.             // Insert your command cases here
  105.  
  106.         default:
  107.             x_CApp::DoCommand(theCommand);
  108.             break;
  109.     }
  110. }
  111.  
  112.  
  113. /******************************************************************************
  114.  GetDocTypeFromDialog
  115.  
  116.     Get the document type from the dialog. If you have multiple
  117.     document types, you must override this function to extract
  118.     the type from the dialog state. (The dialog has been executed
  119.     and OK'd by the user.) If you do not have multiple document
  120.     types, you can remove this function.
  121.  ******************************************************************************/
  122.  
  123. OSType CApp::GetDocTypeFromDialog(CDialogDirector *dialog)
  124.  
  125. {
  126.     return 0;
  127. }
  128.